<template>
  <div class="demo">
    <h2>我是子组件2:{{ msg }}</h2>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import mitter from '@utils/mittBus'

const msg = ref('')

onMounted(() => {
  mitter.on('SendCar', (val) => {
    msg.value = val
  })
})
</script>

<style scoped>
.demo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  background: lightgreen;
}
</style>
@/utils/mittBus
